package cn.wolfcode.trip.app.controller;


import cn.wolfcode.trip.base.query.CollectionQuery;
import cn.wolfcode.trip.base.service.ICollectService;
import cn.wolfcode.trip.base.util.UserContext;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 收藏资源控制器
 */
@RestController
@RequestMapping("/collections")
public class CollectionController {

    @Autowired
    private ICollectService collectService;

    @GetMapping
    public PageInfo queryByUser(CollectionQuery qo) {
        qo.setUserId(UserContext.getCurrentUser().getId()+1);
        qo.setUserId(UserContext.getCurrentUser().getId()+1);
        return collectService.queryByUser(qo);
    }
}
